package android.slc.module.component.player.constant;

import cn.hutool.core.io.FileUtil;
import io.reactivex.rxjava3.core.Scheduler;
import io.reactivex.rxjava3.schedulers.Schedulers;

import java.io.File;

/**
 * TODO 此类应作为Config来设计，暂时先这样
 * @author slc
 * @date 2022/04/12 下午 4:08
 */
public class ConstantsPlayer {
    /**
     * 默认缓存路径
     */
    private static String DEF_CACHE_PATH = System.getProperty("user.dir") + File.separator + "data" + File.separator + "media_cache" + File.separator;
    //public static final String DEF_CACHE_PATH = File.separator + "tmp" + File.separator + "data" + File.separator + "media_cache" + File.separator;
    /**
     * 默认录制超时时长（小时）
     */
    public static final int DEF_REC_TIME_OUT = 12;
    /**
     * 调度器
     */
    public static final Scheduler OBSERVE_ON_SCHEDULER = Schedulers.newThread();
    /**
     * 视频截图生成失败重试次数
     */
    public static final int VIDEO_SCREENSHOT_CREATE_ERROR_RETRY = 5;

    public static String getDefCachePath() {
        FileUtil.mkParentDirs(DEF_CACHE_PATH);
        return DEF_CACHE_PATH;
    }

    public static void setDefCachePath(String cachePath) {
        DEF_CACHE_PATH = cachePath;
    }

}
